<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>属性选择符 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="./CSS样式.html" />
    
    
    <link rel="prev" href="./伪类选择符.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.8"
        data-chapter-title="属性选择符"
        data-filepath="属性选择符.md"
        data-basepath="."
        data-revision="Fri Sep 01 2017 15:57:44 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="CSS选择符.html">
            
                
                    <a href="./CSS选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        CSS选择符
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="CSS的www.html">
            
                
                    <a href="./CSS的www.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        CSS的www
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="CSS的引入.html">
            
                
                    <a href="./CSS的引入.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        CSS的引入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="ID及class选择符.html">
            
                
                    <a href="./ID及class选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        ID及class选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="关系选择符.html">
            
                
                    <a href="./关系选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        关系选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="群组选择符.html">
            
                
                    <a href="./群组选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        群组选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="伪对象选择符.html">
            
                
                    <a href="./伪对象选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        伪对象选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="伪类选择符.html">
            
                
                    <a href="./伪类选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        伪类选择符
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="1.8" data-path="属性选择符.html">
            
                
                    <a href="./属性选择符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        属性选择符
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS样式.html">
            
                
                    <a href="./CSS样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS样式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS字体，颜色和文本属性.html">
            
                
                    <a href="./CSS字体，颜色和文本属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        CSS字体，颜色和文本属性
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="Bootstrap.html">
            
                
                    <a href="./Bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Bootstrap
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x7B26;">&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x7B26;</h2>
<h6 id="1-eatt-&#x9009;&#x62E9;&#x5177;&#x6709;attr&#x5C5E;&#x6027;&#x7684;e&#x5143;&#x7D20;&#x3002;">1. E[att] &#x9009;&#x62E9;&#x5177;&#x6709;attr&#x5C5E;&#x6027;&#x7684;E&#x5143;&#x7D20;&#x3002;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
option[disabled]{color: red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;select name=&quot;&quot;&gt;
&lt;option value=&quot;0&quot;&gt;&#x706B;&#x8F66;&lt;/option&gt;
&lt;option value=&quot;1&quot; disabled=&quot;disabled&quot;&gt;&#x6C7D;&#x8F66;&lt;/option&gt;
&lt;option value=&quot;2&quot;&gt;&#x8F6E;&#x8239;&lt;/option&gt;
&lt;option value=&quot;3&quot;&gt;&#x98DE;&#x673A;&lt;/option&gt;
&lt;/select&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x663E;&#x793A;&#x6C7D;&#x8F66;&#x4E3A;&#x7EA2;&#x8272;&#x3002;&#x5982;&#x679C;&#x8981;&#x5168;&#x90E8;&#x53D8;&#x4E3A;&#x7EA2;&#x8272;&#x53EF;&#x628A; disabled &#x6362;&#x4E3A; value&#x3002;</li>
</ul>
<h6 id="2-eattval-&#x9009;&#x62E9;&#x5177;&#x6709;att&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x7B49;&#x4E8E;val&#x7684;e&#x5143;&#x7D20;&#x3002;&#xFF08;&#x4ED6;&#x4E0D;&#x4EC5;&#x8981;&#x6709;&#x7B26;&#x5408;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x503C;&#x4E5F;&#x8981;&#x7B26;&#x5408;&#x624D;&#x4F1A;&#x88AB;&#x9009;&#x4E2D;&#x3002;&#xFF09;">2. E[att=&quot;val&quot;] &#x9009;&#x62E9;&#x5177;&#x6709;att&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x7B49;&#x4E8E;val&#x7684;E&#x5143;&#x7D20;&#x3002;&#xFF08;&#x4ED6;&#x4E0D;&#x4EC5;&#x8981;&#x6709;&#x7B26;&#x5408;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x503C;&#x4E5F;&#x8981;&#x7B26;&#x5408;&#x624D;&#x4F1A;&#x88AB;&#x9009;&#x4E2D;&#x3002;&#xFF09;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;/&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
input[type=&quot;text&quot;]{height: 100px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;text&quot; placeholder=&quot;&#x8FD9;&#x662F;&#x6587;&#x672C;&#x6846;&quot;/&gt;
&lt;input type=&quot;password&quot; placeholder=&quot;&#x8FD9;&#x662F;&#x5BC6;&#x7801;&quot;/&gt;
&lt;input type=&quot;radio&quot;/&gt;
&lt;input type=&quot;submit&quot;/&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x663E;&#x793A;&#x8F93;&#x5165;&#x6587;&#x672C;&#x533A;&#x57DF;&#x9AD8;&#x4E3A;100&#x50CF;&#x7D20;</li>
</ul>
<h6 id="3-eattval&#x9009;&#x62E9;&#x5177;&#x6709;attr&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x4E3A;&#x4E00;&#x7528;&#x7A7A;&#x683C;&#x5206;&#x9694;&#x7684;&#x5B57;&#x8BCD;&#x5217;&#x8868;&#xFF0C;&#x4E14;&#x5143;&#x7D20;&#x503C;&#x5217;&#x8868;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x7B26;&#x5408;val&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;">3. E[att~=&quot;val&quot;]&#x9009;&#x62E9;&#x5177;&#x6709;attr&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x4E3A;&#x4E00;&#x7528;&#x7A7A;&#x683C;&#x5206;&#x9694;&#x7684;&#x5B57;&#x8BCD;&#x5217;&#x8868;&#xFF0C;&#x4E14;&#x5143;&#x7D20;&#x503C;&#x5217;&#x8868;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x7B26;&#x5408;val&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;/&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
p[class~=p1]{color: red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
&lt;p class=&quot;p1 pMore pColor&quot;&gt;&#x968F;&#x4FBF;&#x5199;&#x70B9;&lt;/p&gt;
&lt;p class=&quot;pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E8C;&lt;/p&gt;
&lt;p class=&quot;p12 pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E09;&lt;/p&gt;
&lt;p class=&quot;p11 pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x56DB;&lt;/p&gt;
&lt;p class=&quot;pMore p1 pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E94;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x663E;&#x793A;&#x4E3A;&#x7B2C;&#x4E00;&#x4E2A;&#x548C;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x662F;&#x7EA2;&#x8272;&#x7684;&#x3002;</li>
</ul>
<h6 id="4eattval&#x9009;&#x62E9;e&#x5143;&#x7D20;&#x4E2D;&#x6709;att&#x5C5E;&#x6027;&#xFF0C;&#x4E14;&#x4EE5;val&#x5F00;&#x5934;&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;">4.E[att^=&quot;val&quot;]&#x9009;&#x62E9;E&#x5143;&#x7D20;&#x4E2D;&#x6709;att&#x5C5E;&#x6027;&#xFF0C;&#x4E14;&#x4EE5;val&#x5F00;&#x5934;&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;/&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
p[class^=p]{color: red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
&lt;p class=&quot;p1 pMore pColor&quot;&gt;&#x968F;&#x4FBF;&#x5199;&#x70B9;&lt;/p&gt;
&lt;p class=&quot;pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E8C;&lt;/p&gt;
&lt;p class=&quot;p12 pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E09;&lt;/p&gt;
&lt;p class=&quot;p11 pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x56DB;&lt;/p&gt;
&lt;p class=&quot;pMore p1 pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E94;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x5168;&#x90E8;&#x663E;&#x793A;&#x4E3A;&#x7EA2;&#x8272;&#x3002;</li>
</ul>
<h6 id="5eattval&#x9009;&#x62E9;e&#x5143;&#x7D20;&#x4E2D;&#x6709;att&#x5C5E;&#x6027;&#xFF0C;&#x4E14;&#x4EE5;&#x7ED3;&#x5C3E;&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;">5.E[att$=&quot;val&quot;]&#x9009;&#x62E9;E&#x5143;&#x7D20;&#x4E2D;&#x6709;att&#x5C5E;&#x6027;&#xFF0C;&#x4E14;&#x4EE5;&#x7ED3;&#x5C3E;&#x7684;&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;/&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
p[class$=p]{color: red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
&lt;p class=&quot;p1 pMore pColor&quot;&gt;&#x968F;&#x4FBF;&#x5199;&#x70B9;&lt;/p&gt;
&lt;p class=&quot;pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x4E8C;&lt;/p&gt;
&lt;p class=&quot;p12 pMore pColorp&quot;&gt;&#x6BB5;&#x843D;&#x4E09;&lt;/p&gt;
&lt;p class=&quot;p11 pMore pColor&quot;&gt;&#x6BB5;&#x843D;&#x56DB;&lt;/p&gt;
&lt;p class=&quot;pMore p1 pColorp&quot;&gt;&#x6BB5;&#x843D;&#x4E94;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x6BB5;&#x843D;&#x4E09;&#x548C;&#x6BB5;&#x843D;&#x4E94;&#x4E3A;&#x7EA2;&#x8272;</li>
</ul>
<h6 id="6eattval-&#x9009;&#x62E9;&#x5177;&#x6709;att&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x5305;&#x542B;val&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x7684;e&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;">6.E[att*=&quot;val&quot;] &#x9009;&#x62E9;&#x5177;&#x6709;att&#x5C5E;&#x6027;&#x4E14;&#x5C5E;&#x6027;&#x503C;&#x5305;&#x542B;val&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x7684;E&#x5143;&#x7D20;&#x3002;&#x793A;&#x4F8B;&#xFF1A;</h6>
<pre><code>    &#x5982;&#x4E0B;&#x4F8B;&#x5B50;:
</code></pre><pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;/&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
a[href*=&quot;jd&quot;]{color: red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href=&quot;http://www.baidu.com&quot;&gt;&#x767E;&#x5EA6;&lt;/a&gt;
&lt;a href=&quot;http://www.taobao.com&quot;&gt;&#x6DD8;&#x5B9D;&lt;/a&gt;
&lt;a href=&quot;http://www.jd.com&quot;&gt;&#x4EAC;&#x4E1C;&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre><ul>
<li>&#x4EAC;&#x4E1C;&#x663E;&#x793A;&#x4E3A;&#x7EA2;&#x8272;</li>
</ul>
<blockquote>
<p>&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x7B26;&#x4E0D;&#x517C;&#x5BB9;IE7&#x4EE5;&#x4E0B;</p>
</blockquote>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="./伪类选择符.html" class="navigation navigation-prev " aria-label="Previous page: 伪类选择符"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="./CSS样式.html" class="navigation navigation-next " aria-label="Next page: CSS样式"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
